home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug231 / number.h < prev    next >
Text File  |  1987-06-17  |  896b  |  49 lines

  1. /*
  2.     Little Smalltalk number definitions
  3.  
  4. */
  5. /*
  6.     integer and character definitions
  7.     for integers
  8.         i_size = INTEGERSIZE
  9.  
  10.     for characters
  11.         i_size = CHARSIZE
  12.  
  13. */
  14.  
  15. struct int_struct {
  16.         int     i_ref_count;
  17.     int     i_size;
  18.     int    i_value;
  19.     };
  20.  
  21. typedef struct int_struct integer;
  22.  
  23. # define int_value(x) (((integer *)x)->i_value)
  24. # define char_value(x) ((char) int_value(x))
  25.  
  26. extern object *new_cori();    /* new Character OR Integer */
  27.  
  28. # define new_int(x) new_cori(x, 1)
  29. # define new_char(x) new_cori(x, 0)
  30.  
  31. # define INTINITMAX 50
  32.  
  33. /*
  34.     floating point definitions
  35.     size should always be FLOATSIZE
  36. */
  37.  
  38. struct float_struct {
  39.     int    f_ref_count;
  40.     int    f_size;
  41.     double    f_value;
  42.     };
  43.  
  44. typedef struct float_struct sfloat;
  45.  
  46. # define float_value(x) (((sfloat *)x)->f_value)
  47.  
  48. extern object *new_float();
  49.